package com.demo.easy.oneLine;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @Author:YuXuePeng
 * @Date:Created in 2023/4/14 17:11
 */
public class TemplateHeadlerListener extends AnalysisEventListener<TemplateHeadlerEntity> {
    private List<TemplateHeadlerEntity> list = new ArrayList<TemplateHeadlerEntity>();
    @Override
    public void invoke(TemplateHeadlerEntity templateHeadlerEntity, AnalysisContext analysisContext) {
        list.add(templateHeadlerEntity);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
    public List<TemplateHeadlerEntity> getList() {
        return list;
    }

    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        for (Integer key : headMap.keySet()){
            System.out.println(key + ":" + headMap.get(key) + "\t");
        }
        System.out.println();
    }
}
